MyUserPaneTrackingProc
NEW WITH THE APPEARANCE MANAGER
Tracks a control while the user holds down the mouse button.The Control Manager declares the type for an application-defined user pane tracking function as follows:
typedef pascal ControlPartCode (*ControlUserPaneTrackingProc)( ControlHandle control, Point startPt, ControlActionUPP actionProc);The Control Manager defines the data typeControlUserPaneTrackingUPP
to identify the universal procedure pointer for this application-defined function:
typedef UniversalProcPtr ControlUserPaneTrackingUPP;You typically use theNewControlUserPaneTrackingingProc
macro like this:
ControlUserPaneTrackingUPP
myControlUserPaneTracking
UPP;
myControlUserPaneTracking
UPP =NewControlUserPaneTracking
Proc
(MyUserPaneTracking
);You typically use the
CallControlUserPaneTrackingingProc
macro like this:
CallControlUserPaneTracking
Proc(myControlUserPaneTracking
UPP, control, startPt, actionProc);Here's how to declare the function
MyUserPaneTrackingProc:
pascal ControlPartCode MyUserPaneTrackingProc ( ControlHandle control, Point startPt, ControlActionUPP actionProc);
control
- A handle to the control in which the mouse-down event occurred.
startPt
- The location of the cursor at the time the mouse button was first pressed, in local coordinates. Your application retrieves this point from the
where
field of the event structure.actionProc
- A pointer to an action function defining what action your application takes while the user holds down the mouse button. The value of the
actionProc
parameter can be a validprocPtr
,nil
, or -1. A value of -1 indicates that the control should either perform auto tracking, or if it is incapable of doing so, do nothing (likenil
).- function result
- Returns the part code of the control part that was tracked. If tracking was unsuccessful,
kControlNoPartCode
is returned.DISCUSSION
YourMyUserPaneTrackingProc
function should track the control by repeatedly calling the action function specified in theactionProc
parameter until the mouse button is released. When the mouse button is released, your function should return the part code of the control part that was tracked.This function will only get called if you've set the
kControlHandlesTracking
feature bit on creation of the user pane control. Once you have created the functionMyUserPaneTrackingProc
, passkControlUserPaneTrackingProcTag
in thetagName
parameter ofSetControlData
.